<?php 
class LanguageController extends AdminController
{
	public function actionTranslate()
	{
		$model = new TranslateForm();
		if (Yii::app()->session['lang'])
			$model->language = Yii::app()->session['lang'];
		
		if(isset($_POST['TranslateForm'])) {
			$model->attributes=$_POST['TranslateForm'];
			$model->save();
			Yii::app()->session['lang'] = $model->language;
			$this->redirect(array('translate'));
		}
		
		$this->render('translate',array(
			'model'=>$model,
		));
	}

}